<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />


    <link href="/static/v5/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/static/v5/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/v5/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link href="/static/v5/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
    <link href="/static/v5/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/static/v5/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
    <title></title>
</head>
<body>
<nav class="breadcrumb">
    <button type="submit" class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px; margin-left: 5px" onclick="javascript:history.back(-1);" >返回</button>
</nav>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-member-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text"  placeholder="" id="code_name" name="code_name">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排序：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text"  th:value="0" id="dict_sort" name="dict_sort">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" id="submit_bt" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<script type="text/javascript" src="/static/v5/lib/jquery/1.9.1/jquery.min.js"></script>
<script  th:inline="javascript">
    /*<![CDATA[*/
    var code_type = [[${code_type}]]
    var parent_id = [[${parent_id}]]
    /*]]>*/

    $("#submit_bt").click(function () {

        var data = "token=" + sessionStorage.getItem("token") + "&code_type=" + code_type  +  "&code_name=" + $("#code_name").val()
            +  "&dict_sort=" + $("#dict_sort").val() + "&parent_id=" + parent_id
        $.ajax({
            type:'post',
            url:'/v5/dict/add',
            dataType : 'json',
            data: data,

            success:function(data){
                if (data.mark=="0") {
                    alert(data.tip);
                } else {
                    alert(data.tip);
                }
            },
            error: function(textStatus) {
                alert(textStatus);
            }

        });
    });
</script>
</body>
</html>





